home *** CD-ROM | disk | FTP | other *** search
/ Shareware Grab Bag / Shareware Grab Bag.iso / 001 / qfon.bas (.txt) < prev    next >
Encoding:
GW-BASIC  |  1985-10-19  |  6.4 KB  |  109 lines

  1. 10  KEY OFF
  2. 20  D%=200
  3. 30  DIM U(200),N$(200),P$(2)
  4. 40  GOSUB 920
  5. 50  CLS:PRINT"Attempting to load QMODEM.FON on the default drive..."
  6. 60  OPEN "QMODEM.FON" FOR INPUT AS #1
  7. 70  FOR X=1 TO D%
  8. 80  N$(X)=INPUT$(48,1)
  9. 90  NEXT X
  10. 100  CLOSE
  11. 110  PRINT"QMODEM.FON successfully loaded..."
  12. 120  PRINT"Now marking unused entries..."
  13. 130  FOR X=1 TO D%
  14. 140  IF MID$(N$(X),2,25)<>"-------------------------" THEN 160
  15. 150  U(X)=1:PRINT CHR$(254);
  16. 160  NEXT X:PRINT
  17. 170  P$(0)="N":P$(1)="E":MODEM=1
  18. 180  PRINT"SOUNDSOUNDSOUNDSOUNDSOUNDSOUNDSOUNDSOUNDSOUNDSOUNDSOUNDSOUNDSOUNDSOUNDSOUNDSOUNDSOUNDSOUNDSOUNDSOUNDSOUNDSOUNDSOUNDSOUNDSOUNDSOUNDSOUNDSOUNDSOUNDSOUNDSOUNDSOUNDSOUNDSOUNDSOUNDSOUNDSOUNDSOUNDSOUNDSOUNDSOUNDSOUNDSOUNDSOUNDSOUND":P=0:J$=""
  19. 185  IF SHORT=1 THEN PRINT"MENU:C)ons P)rint W:disk M)rk U)nmrk T)ogl S)wap D)el A)lpha X)pert F)ile E)xit";:GOTO 300
  20. 190  PRINT"SELECT:  [C] View existing numbers on console"
  21. 200  PRINT"         [P] Dump existing numbers to printer"
  22. 210  PRINT"         [W] Write existing numbers to a disk file; does not save changes"
  23. 220  PRINT"         [M] Mark a section of the list for non-printing"
  24. 230  PRINT"         [U] Unmark marked entries in a section of the list"
  25. 240  PRINT"         [T] Toggle:  Show modem parameters during dumps?  (now ";:IF MODEM=1 THEN PRINT"yes)" ELSE PRINT"no)"
  26. 250  PRINT"         [S] Swap two numbers' locations on the list"
  27. 260  PRINT"         [D] Delete an entry from the list"
  28. 270  PRINT"         [A] Alphabetically sort any range of entries on the list"
  29. 275  PRINT"         [X] eXpert user mode; shorten this menu's display"
  30. 280  IF CHANGED THEN PRINT"         [F] File changes, overwriting old qmodem.fon file"
  31. 290  PRINT"         [E] Exit this program";:IF CHANGED THEN PRINT" WITHOUT FILING CHANGES";
  32. 300  X$=INPUT$(1):PRINT:IF X$>"_" THEN X$=CHR$(ASC(X$)-32)
  33. 305  IF X$="X" THEN SHORT=1-SHORT:GOTO 180
  34. 310  IF X$="E" THEN END
  35. 320  IF X$="M" THEN 560
  36. 330  IF X$="U" THEN 840
  37. 340  IF X$="P" THEN P=1:PRINT"Ready printer and press any key [<ESC> to abort print]:":X$=INPUT$(1): IF ASC(X$)=27 THEN 180 ELSE 430
  38. 350  IF X$="W" THEN 880
  39. 360  IF X$="T" THEN MODEM=1-MODEM:GOTO 180
  40. 370  IF X$="S" THEN 610
  41. 380  IF X$="F" THEN 710
  42. 390  IF X$="D" THEN 670
  43. 400  IF X$="A" THEN 760
  44. 410  IF X$<>"C" THEN 180
  45. 420  PRINT"Press any key to start list [<ESC> halts output]:":X$=INPUT$(1):IF ASC(X$)=27 THEN 180
  46. 430  A$="Dial# |  Name                     | Telephone No. | Parameters  | Notes      |":IF P=0 THEN CLS
  47. 440  B$="------+---------------------------+---------------+-------------+------------|":IF MODEM=0 THEN A$=LEFT$(A$,51):B$=LEFT$(B$,51)
  48. 450  N$=A$+CHR$(13)+J$+B$:IF P=1 THEN LPRINT N$ ELSE IF P=2 THEN PRINT #1,N$ ELSE PRINT N$
  49. 460  FOR X=1 TO D%: IF U(X) THEN 490 ELSE GOSUB 500
  50. 470  IF INKEY$=CHR$(27) THEN X=D%
  51. 480  IF P=1 THEN LPRINT N$ ELSE IF P=2 THEN PRINT #1,N$ ELSE PRINT N$
  52. 490  NEXT X:CLOSE:PRINT"ERRTHENTHENTHENTHENTHENTHENTHENTHENTHENOPTION":PRINT"CALLFinished.CALL":PRINT"ERLTHENTHENTHENTHENTHENTHENTHENTHENTHENSAVE":PRINT:GOTO 180
  53. 500  N$="":IF X<100 THEN N$=" ":IF X<10 THEN N$="  "
  54. 510  N$=N$+STR$(X)+". | "+MID$(N$(X),2,25)+" |": U=ASC(MID$(N$(X),27,1)):IF U=14 THEN 530
  55. 520  FOR Y=28+U TO 41:MID$(N$(X),Y,1)=" ":NEXT Y
  56. 530  N$=N$+MID$(N$(X),28,14)+" |"+STR$(ASC(MID$(N$(X),43,1))*300)+",":IF ASC(MID$(N$(X),43,1))=1 THEN N$=N$+" "
  57. 540  N$=N$+STR$(ASC(MID$(N$(X),44,1)))+","+P$(ASC(MID$(N$(X),48,1)))+","+STR$(ASC(MID$(N$(X),46,1)))+"|____________|"
  58. 545  IF MODEM=0 THEN N$=LEFT$(N$,51)
  59. 550  RETURN
  60. 560  PRINT:PRINT"This section of the program will mark a range of entries so that the C,P, and W commands can not read them. It will not have any effect on the QMODEM.FON file."
  61. 570  INPUT"Enter the endpoints of the range to mark [0,0 to abort mark]: ";X,U
  62. 580  IF X<1 OR U<1 OR X>D% OR U>D% THEN 180
  63. 590  IF U<X THEN SWAP X,U
  64. 600  FOR P=X TO U:U(P)=1:PRINT"<UNK! {FE22}>;:NEXT P:PRINT:GOTO 180
  65. 610  PRINT:PRINT"This section of the program will swap any two entries in the phone list, marked or unmarked.  When the QMODEM.FON file is saved with the 'F' option at the main menu, these changes will go into effect.":PRINT
  66. 620  INPUT"Enter the numbers of the two entries to swap [0,0 to abort swap]: ";X,P
  67. 630  IF X<1 OR X>D% OR P<1 OR P>D% OR X=P THEN 180
  68. 640  GOSUB 500:PRINT N$:SWAP X,P:GOSUB 500:PRINT N$
  69. 650  PRINT:PRINT"OK to swap these two entries? (Y/N) ";:X$=INPUT$(1):IF X$<>"y" AND X$<>"Y" THEN 180
  70. 660  SWAP N$(P),N$(X):CHANGED =1:PRINT"Swapped.":GOTO 180
  71. 670  PRINT:PRINT"This section of the program will replace an entry's name and phone number with  dashes.  When the QMODEM.FON file is saved with the 'F' option at the main menu,these changes will go into effect.  Enter 0 to abort deletion.":PRINT
  72. 680  INPUT "What is the number of the entry you wish to delete";X:IF X<1 OR X>D% THEN 180
  73. 690  GOSUB 500:PRINT N$:PRINT:PRINT"OK to delete this entry?  (Y/N) ";:X$=INPUT$(1):PRINT:IF X$<>"y" AND X$<>"Y" THEN 180
  74. 700  MID$(N$(X),2)="-------------------------":MID$(N$(X),27)=CHR$(14)+"- --- --- ----":CHANGED=1:GOTO 180
  75. 710  IF CHANGED<>1 THEN 180
  76. 720  PRINT"OVERWRITE OLD QMODEM.FON FILE? (Y/N) ";:X$=INPUT$(1):IF X$<>"y" AND X$<>"Y" THEN 180
  77. 730  OPEN "QMODEM.FON" FOR OUTPUT AS #1
  78. 740  FOR X=1 TO D%: PRINT #1,N$(X);:NEXT X
  79. 750  CHANGED = 0:GOTO 180
  80. 760  PRINT:PRINT"This section of the program will alphabetize any range of entries on the list.  Marked entries will fall to the bottom of the list.  When the QMODEM.FON file   is saved with the 'F' option at the main menu,these changes will go into effect."
  81. 770  INPUT "Enter the endpoints of the range to alphabetize [0,0 to abort alphabetization:  ";U,P:IF U<1 OR U>D% OR P<1 OR P>D% OR U=P THEN 180
  82. 780  IF U>P THEN SWAP U,P
  83. 790  FOR I=U TO P:FOR X=U TO P+U-I-1
  84. 800  IF N$(X)<N$(X+1) OR U(X+1)=1 THEN 820
  85. 810  SWAP N$(X),N$(X+1)
  86. 820  NEXT X:NEXT I:CHANGED=1:GOTO 180
  87. 830  PRINT:PRINT"This section of the program will unmark a range of entries so that the C,P,and Wcommands can read them.  It will not have any effect on the QMODEM.FON file."
  88. 840  INPUT"Enter the endpoints of the range to unmark [0,0 to abort unmark]: ";X,U
  89. 850  IF X<1 OR U<1 OR X>D% OR U>D% THEN 180
  90. 860  IF U<X THEN SWAP X,U
  91. 870  FOR P=X TO U:U(P)=0:PRINT"<UNK! {0004}>";:NEXT P:PRINT:GOTO 180
  92. 880  PRINT"This will produce a disk file containing the same list as viewed with the 'C' or'P' commands.  It will be saved on the default drive under the name PHONE.LST . Ready disk and press any key [<ESC> to abort write]:"
  93. 890  X$=INPUT$(1):IF ASC(X$)=27 THEN 180
  94. 900  OPEN "phone.lst" FOR OUTPUT AS #1
  95. 910  P=2:J$=CHR$(10):GOTO 430
  96. 920  CLS:PRINT"CSRLINCSRLINCSRLINWENDWENDWENDWHILEWHILEWHILELINELINELINE<UNK! {00F9}> ";:COLOR 9:PRINT"THE";:COLOR 7:PRINT" QMODEM PHONE LIST UTILITY<UNK! {00F9}> by Justin Boyan, 2/85 <UNK! {00F9}>LINELINELINEWHILEWHILEWHILEWENDWENDWENDCSRLINCSRLINCSRLIN"
  97. 930  PRINT STRING$(77,205)
  98. 940  PRINT:PRINT"   This program reads in the QMODEM.FON file from the current directory,"
  99. 950  PRINT:PRINT"   interprets the various control codes, and automatically marks all the"
  100. 960  PRINT:PRINT"   unused entries.  It then gives you the option to view the unmarked numbers"
  101. 970  PRINT:PRINT"   on the console, dump the unmarked numbers to the printer, dump the unmarked"
  102. 980  PRINT:PRINT"   numbers to a disk file, mark additional numbers on the list, unmark numbers"
  103. 990  PRINT:PRINT"   which have already been marked, swap two numbers' locations on the list,"
  104. 1000  PRINT:PRINT"   alphabetically sort any range of entries on the list, file the changes in"
  105. 1010  PRINT:PRINT"   a new QMODEM.FON file, and exit the program."
  106. 1020  PRINT STRING$(77,205):PRINT
  107. 1030  PRINT"   For info, call (by modem) the Elkridge Electronics RBBS - (301)-796-1223.":PRINT
  108. 1040  COLOR 23:PRINT"INSERT THE DISK CONTAINING QMODEM.FON INTO THE CURRENT DRIVE AND PRESS ANY KEY.";:COLOR 7:X$=INPUT$(1):RETURN
  109.